package com.niiwoo.civet.scheduler.trigger;

import com.alibaba.dubbo.config.annotation.Reference;
import com.niiwoo.civet.trade.service.koala.KaoLaRepayBackJobDubboService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;


/**
 * @description 考拉理财还款回调--查询状态为处理中的还款请求，根据查询结果更新还款结果.
 * @author daizhiyue
 * @date 2017-1-12
 */
@Slf4j
@Component
public class KaoLaRepayBackDealJobTrigger {

    @Reference(version = "1.0.0")
    KaoLaRepayBackJobDubboService kaoLaRepayBackJobDubboService;

    @Scheduled(cron = "${kaola.deal_repay_back_fail}")
    public void dealRepayBackFailJob() {
        log.info("dealRepayBackUnSuccessJob start");
        kaoLaRepayBackJobDubboService.dealRepayBackkFailJob();
        log.info("dealRepayBackUnSuccessJob end");
    }

    @Scheduled(cron = "${kaola.withhold_success_repay_back_fail}")
    public void dealWithholdBackDealingForKFTJob(){
        log.info("dealWithholdBackDealingForKFTJob start");
        kaoLaRepayBackJobDubboService.dealWithholdBackDealingForKFTJob();
        log.info("dealWithholdBackDealingForKFTJob end");
    }


}